#!/bin/bash

if [ "$1" != "" ]; then
    echo 1st param have value
else
    echo 1st param haven\'t value
fi

if [ "$2" != "" ]; then
    echo 2nd param have value
else
    echo 2nd param haven\'t value
fi

if true;
then
    echo true
else
    echo false
fi


cnt=0
while true; do
    echo while $((cnt++))
    if [ $cnt -ge 3 ]; then
        break
    else
        continue
    fi
done

for i in $(seq 3); do
    echo "for1 $i"
done

for i in "a b c d"; do
    echo "for2  $i"
done

str="1 2 3 4"
for i in $str; do
    echo "for3   $i"
done

for i in a b c d; do
    echo "for4    $i"
done


while true; do
    read -p "input item: " item
    case $item in
        1)
            echo case 1
            ;;
        2)
            echo case 2
            ;;
        3)
            echo case 3
            ;;
        exit)
            echo case exit, exting
            break
            ;;
        5*)
            echo case 5*
            ;;
        *)
            echo default
            ;;
        4)
            echo case 4
            ;;
    esac
done
